//2009/08/19 15:05:08
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class FowlRoad
{
public:
    int crossings(int roadY, vector <int> bobX, vector <int> bobY)
    {
		int ret = 0;
		vector<int> v;
		for(int i=0; i<bobY.size(); i++) if(bobY[i] != roadY) v.push_back(bobY[i]);
		for(int i=1; i<v.size(); i++)
		{
			if((roadY - v[i-1]) * (roadY - v[i]) < 0) ret ++;
		}
		return ret;
    }
};
